package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by chengang on 2017/7/26.
 */

public class UpdateInfoApi extends BaseApi {

    UpdateInfoReq req;
    public UpdateInfoApi(String member_id,String column_name, String column_value) {
        req = new UpdateInfoReq(member_id,column_name, column_value);

    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).updateInfo(requestBody);
    }

    class UpdateInfoReq {
        public String member_id;
        public String column_name;
        public String column_value;

        public UpdateInfoReq(String member_id, String column_name, String column_value){
            this.member_id = member_id;
            this.column_name = column_name;
            this.column_value = column_value;
        }
    }
}
